# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=libfossil
pkgver=0.20240211.1220
_fslhash=8caf0ac36e
pkgrel=0
pkgdesc="Unofficial Fossil SCM library"
url="https://fossil.wanderinghorse.net/r/libfossil"
arch="all !ppc64le !riscv64 !s390x" # ftbfs
license="BSD-2-Clause"
makedepends="bash tcl zlib-dev"
subpackages="$pkgname-apps $pkgname-dev"
source="https://fossil.wanderinghorse.net/r/libfossil/tarball/$_fslhash/libfossil-$_fslhash.tar.gz"
builddir="$srcdir/$pkgname-$_fslhash"
options="!check" # no tests provided

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--no-c++ \
		--no-debug \
		--no-fnc
	make
}

package() {
	make DESTDIR="$pkgdir" install

	install -Dvm644 include/*.h -t "$pkgdir"/usr/include/
	install -Dvm644 include/fossil-scm/*.h -t "$pkgdir"/usr/include/fossil-scm/
}

apps() {
	pkgdesc="$pkgdesc (command-line apps)"

	amove usr/bin
}

sha512sums="
61a5d4f358ff786db5ddbfafb545b040813597b9e6fb887135cb2a4f61039eeaa4ba6a7231347e642e6809a1715e4cae331f006e078685fce1ffc26b9701be11  libfossil-8caf0ac36e.tar.gz
"
